<template>
	<div class="left-box">
		<div class="heade-wrapper">
			<a-input-search
				:placeholder="this.$i18n('selectPeople.input',this.$i18n('org.admin.label'))"
				v-model.trim="searchValue"
				@search="searchHandle"
			>
			</a-input-search>
		</div>
		<div class="content-wrapper">
			<scroll-list
				panel="Admin"
				command="memberList"
				ref="scrollList"
				:initSearchValue="initSearchValue"
			/>
		</div>
	</div>
</template>

<script>
import scrollList from '@/components/scrollList';

export default {
	name: 'Admin',
	inject: ['app'],
	components: { scrollList },
	data() {
		return {
			searchValue: '',
			selectAccountId: '',
			initSearchValue: {}
		};
	},
	watch: {},
	computed: {
		showAdminTypes() {
			return this.app().orgSelect.showAdminTypes;
		}
	},
	beforeMount() {
		const { showAdminTypes } = this.app().orgSelect;
		this.initSearchValue = {
			keyword: this.searchValue,
			showAdminTypes: showAdminTypes
		};
	},
	methods: {
		onChangeAccount(ret) {
			console.log(ret, 'Ret');
			this.initProps();
			this.selectAccountId = ret.id;
			this.searchHandle();
		},
		initProps() {
			this.searchValue = '';
		},
		searchHandle() {
			this.$refs.scrollList.search({
				keyword: this.searchValue,
				showAdminTypes: this.showAdminTypes
			});
			console.log(this.searchValue, 'searchValue');
		}
	}
};
</script>

<style lang="scss" scoped>
</style>
